﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FlowThruOrder.aspx.cs"
    Inherits="WMS6.Web.CrossDock.FlowThruOrder" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>FlowThruOrder</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />

    <script src="../Js/jquery.js" type="text/javascript"></script>

    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>

    <script src="../Js/util.js" type="text/javascript"></script>

    <script src="../Js/InitPage.js" type="text/javascript"></script>

    <script src="../Js/Verification.js" type="text/javascript"></script>

    <script src="../Js/checkbox.js" type="text/javascript"></script>

    <script src="../Js/calendar.js" type="text/javascript" charset="gb2312"></script>

    <script type="text/javascript">
        //初始化页面
        window.onload = function(){
            initEditNewPage();
        }
        
        function newASN()
        {
            var from = document.getElementById("hdnFrom").value;
            window.location.href = "FlowThruOrder.aspx?from=" + from;
            return false;
        }
        
        //弹出窗口选择PO
        function popPurchaseOrderQuery()
        {
            var ownerID= document.getElementById('txtOwnerID').value;
            var rtnValue = popModalWindow('../OrderManagement/PurchaseOrderQuery.aspx?action=txtPoID&poType=FlowThru&ownerID='+ownerID,'dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;')
            if(rtnValue != null && rtnValue.toString() != "")
            {              
                document.getElementById("txtPoID").value = (rtnValue.split('@_@'))[0];  
                    
                 __doPostBack("txtPoID_TextChanged","");
            }           
        }
 
         //弹出窗口选择货主
        function selectOwner()
        {
            var rtnValue = popModalWindow('../Configuration/OwnerQuery.aspx?action=txtOwnerID','dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if(rtnValue != null && rtnValue.toString() != "")
            {
                document.getElementById("txtOwnerID").focus();
                document.getElementById("txtOwnerID").value = rtnValue;
            }
        }
        
        //弹出收货人代码
        function selectConsigneeID() 
        {
            var rtnValue = popModalWindow('../Configuration/CustomerQuery.aspx?action=txtConsigneeID', 'dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
          
            if(rtnValue != null && rtnValue.toString() != "")
            {
                document.getElementById("txtConsigneeID").focus();
                document.getElementById("txtConsigneeID").value = rtnValue;
            }

        }
 
    </script>

</head>
<body>
    <form id="F79561" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="div_top">
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:Label ID="lblOwner" runat="server" CssClass="label_header" Text="直通订单" meta:resourcekey="lblOwner"></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnGoBack" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnGoBack%>"  Enabled="false"
                            CausesValidation="False" OnClick="btnGoBack_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnNew" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnNew%>" Enabled="false"
                            AccessKey="n" OnClientClick="newASN();return false;" />
                    </td>
                    <td>
                        <asp:Button ID="btnSave" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnSave%>" Enabled="false"
                            AccessKey="s" OnClick="btnSave_Click" OnClientClick="SethdnPageQty('hdnPageQty');" />
                    </td>
                    <td>
                        <asp:Button ID="btnDelete" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnDelete%>" Enabled="false"
                            AccessKey="d" OnClientClick="javascript:if(confirmMsg('F4100_001')) return true; else return false;"
                            OnClick="btnDelete_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnCopy" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnCopy%>" Enabled="false"
                            AccessKey="c" OnClick="btnCopy_Click" />
                    </td>                    
                </tr>
            </table>
        </div>
        <asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>
                <div>
                    <asp:Label ID="lblMsg" runat="server" CssClass="label_message" meta:resourcekey="lblMsg"></asp:Label>
                </div>
                <div id="div_menu">
                    <div style="float: left; width: 8px;">
                        <div class="tabL" id="divL1">
                        </div>
                    </div>
                    <div style="float: left;" class="tabLabelCont tabCur" onclick="setTab('one',1,2)"
                        id="divM1">
                        <asp:Label ID="one1" CssClass="hover" runat="server">常规</asp:Label></div>
                    <div style="float: left; margin-right: 2px;">
                        <div class="tabR" id="divR1">
                        </div>
                    </div>
                    <div style="float: left; width: 8px;">
                        <div class="tabL_1" id="divL2">
                        </div>
                    </div>
                    <div style="float: left;" class="tabLabelCont tabCur_1" onclick="setTab('one',2,2);"
                        id="divM2">
                        <asp:Label ID="one2" CssClass="navigationlabel" runat="server">&nbsp;订单行&nbsp;</asp:Label></div>
                    <div style="float: left; margin-right: 2px;">
                        <div class="tabR_1" id="divR2">
                        </div>
                    </div>
                </div>
                <div id="div_content">
                    <div id="con_one_1" style="display: block;">
                        <table width="720px" style="display: block; margin-left: 10px; margin-top: 10px;">
                            <tr>
                                <td width="180px">
                                    <asp:Label ID="lblOrderID" CssClass="label" runat="server" Text="直通订单号" meta:resourcekey="lblOrderID"></asp:Label>
                                </td>
                                <td width="180px">
                                    <asp:Label ID="lblStatus" CssClass="label" runat="server" Text="状态" meta:resourcekey="lblStatus"></asp:Label>
                                </td>
                                <td width="180px">
                                    <asp:Label ID="lblDoor" runat="server" CssClass="label" Text="门" meta:resourcekey="lblDoor"></asp:Label>
                                </td>
                                <td width="180px">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="180px">
                                    <asp:TextBox ID="txtOrderID" runat="server" CssClass="textbox" meta:resourcekey="txtOrderID"></asp:TextBox>
                                </td>
                                <td width="180px">
                                    <asp:DropDownList ID="ddlStatus" runat="server" CssClass="mediumselectbox" Enabled="false"
                                        meta:resourcekey="ddlStatus">
                                    </asp:DropDownList>
                                </td>
                                <td width="180px">
                                    <asp:TextBox ID="txtDoor" runat="server" CssClass="textbox" meta:resourcekey="txtDoor"></asp:TextBox>
                                </td>
                                <td width="180px">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="180px">
                                    <asp:Label ID="lblPoID" runat="server" CssClass="label" Text="采购订单号" meta:resourcekey="lblPoID"></asp:Label><font
                                        class="must_input">*</font>
                                </td>
                                <td width="180px">
                                    <asp:Label ID="lblOwnerID" runat="server" CssClass="label" Text="货主" meta:resourcekey="lblOwnerID"></asp:Label><font
                                        class="must_input">*</font>
                                </td>
                                <td width="180px">
                                    <asp:Label ID="lblRoute" runat="server" CssClass="label" Text="路线" meta:resourcekey="lblRoute"></asp:Label>
                                </td>
                                <td width="180px">
                                </td>
                            </tr>
                            <tr>
                                <td width="180px">
                                    <asp:TextBox ID="txtPoID" runat="server" CssClass="textbox" AutoPostBack="true" meta:resourcekey="txtTotalExceptQty"
                                        OnTextChanged="txtPoID_TextChanged"></asp:TextBox><img src="../Images/icon_find.gif"
                                            id="img1" runat="server" alt="select one item" class="img" onclick="popPurchaseOrderQuery();" />
                                </td>
                                <td width="180px">
                                    <asp:TextBox ID="txtOwnerID" runat="server" CssClass="textbox" Text="" meta:resourcekey="txtOwnerID"></asp:TextBox><img
                                        src="../Images/icon_find.gif" id="img2" runat="server" alt="select one item"
                                        class="img" onclick="selectOwner();" />
                                </td>
                                <td width="180px">
                                    <asp:TextBox ID="txtRoute" runat="server" CssClass="textbox" meta:resourcekey="txtExternalReceiptID"></asp:TextBox>
                                </td>
                                <td width="180px">
                                </td>
                            </tr>
                            <tr>
                                <td width="180px">
                                    <asp:Label ID="lblExternOrderID" runat="server" CssClass="label" Text="外部订单号" meta:resourcekey="lblExternOrderID"></asp:Label>
                                </td>
                                <td width="180px">
                                    <asp:Label ID="lblConsigneeID" runat="server" CssClass="label" Text="收货人代码" meta:resourcekey="lblConsigneeID"></asp:Label><font
                                        class="must_input">*</font>
                                </td>
                                <td width="180px">
                                    <asp:Label ID="lblStop" runat="server" CssClass="label" Text="站点" meta:resourcekey="lblStop"></asp:Label>
                                </td>
                                <td width="180px">
                                </td>
                            </tr>
                            <tr>
                                <td width="180px">
                                    <asp:TextBox ID="txtExternOrderID" runat="server" CssClass="textbox" Text="" meta:resourcekey="txtExternOrderID"></asp:TextBox>
                                </td>
                                <td width="180px">
                                    <asp:TextBox ID="txtConsigneeID" runat="server" CssClass="textbox" meta:resourcekey="txtConsigneeID"></asp:TextBox><img
                                        src="../Images/icon_find.gif" alt="select one item" id="imgConsigneeID" runat="server"
                                        class="img" onclick="selectConsigneeID();" />
                                </td>
                                <td width="180px">
                                    <asp:TextBox ID="txtStop" runat="server" CssClass="textbox" meta:resourcekey="txtStop"></asp:TextBox>
                                </td>
                                <td width="180px">
                                </td>
                            </tr>
                            <tr>
                                <td width="180px">
                                    <asp:Label ID="lblDeliveryDate" runat="server" CssClass="label" meta:resourcekey="lblDeliveryDate"
                                        Text="要求发货日期"></asp:Label>
                                </td>
                                <td width="180px">
                                    <asp:Label ID="lblExternalLoadID" runat="server" CssClass="label" Text="外部装载号" meta:resourcekey="lblExternalLoadID"></asp:Label>
                                </td>
                                <td width="180px">
                                    <asp:Label ID="lblLoadID" runat="server" CssClass="label" Text="装载号" meta:resourcekey="lblLoadID"></asp:Label>
                                </td>
                                <td width="180px">
                                </td>
                            </tr>
                            <tr>
                                <td width="180px">
                                    <asp:TextBox ID="txtDeliveryDate" runat="server" CssClass="textbox" meta:resourcekey="txtDeliveryDate"></asp:TextBox>
                                    <img alt="请选择日期" class="img" onclick="setday(this,txtDeliveryDate)" src="../Images/calendar.gif" />
                                </td>
                                <td width="180px">
                                    <asp:TextBox ID="txtExternalLoadID" runat="server" CssClass="textbox" meta:resourcekey="txtExternalLoadID"></asp:TextBox>
                                </td>
                                <td width="180px">
                                    <asp:TextBox ID="txtLoadID" runat="server" CssClass="textbox" meta:resourcekey="txtLoadID"></asp:TextBox>
                                </td>
                                <td width="180px">
                                </td>
                            </tr>
                            <tr style="height: 10px;">
                                <td>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr style="height: 10px;">
                                <td>
                                    <asp:CheckBox ID="chkApportion" runat="server" CssClass="checkbox" Text="分配" Enabled="False"
                                        meta:resourcekey="Apportion" />
                                </td>
                                <td>
                                    <asp:CheckBox ID="chkIsActive" runat="server" CssClass="checkbox" Text="是否启用" Checked="true"
                                        meta:resourcekey="Apportion" />
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="con_one_2" style="display: none; overflow-x: auto; overflow-y: hidden;">
                        <table width="1080px" style="display: block; margin-left: 10px; margin-top: 10px;">
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr style="height: 10px;">
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div>
                                        <div>
                                            <asp:GridView ID="gvXorderDetail" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                                                AllowPaging="True" CssClass="gridview" Width="850px" OnInit="gvXorderDetail_Init"
                                                OnRowDataBound="gvXorderDetail_RowDataBound" OnSorting="gvXorderDetail_Sorting"
                                                meta:resourcekey="gvOrderDetail">
                                                <FooterStyle CssClass="GridViewFooterStyle" />
                                                <RowStyle CssClass="GridViewRowStyle" />
                                                <HeaderStyle CssClass="GridViewHeaderStyle" />
                                                <PagerStyle CssClass="GridViewPageStyle" />
                                                <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                                <Columns>
                                                    <asp:TemplateField meta:resourcekey="TemplateField">
                                                        <HeaderTemplate>
                                                            <img src="../Images/gvSettingpic.gif" id="img01" class="gvSettingImg" onclick="gvUserSetting('7011','gvOrderDetail');"
                                                                onmouseover="showGVUserSettingAlt(this);" alt="customize list" />
                                                            <asp:CheckBox ID="CheckBox1" runat="server" onclick="selectAll(this,'gvXorderDetail');"
                                                                meta:resourcekey="CheckBox1" />
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="chbSelect" runat="server" meta:resourcekey="chbSelect" />
                                                        </ItemTemplate>
                                                        <FooterTemplate>
                                                            <asp:CheckBox ID="CheckBox2" runat="server" onclick="selectAll(this,'gvXorderDetail');"
                                                                meta:resourcekey="CheckBox2" />
                                                        </FooterTemplate>
                                                        <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                                                        <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="明细" FooterText="明细" meta:resourcekey="Detail">
                                                        <ItemTemplate>
                                                            <a href='<%# FormatFlowThroUrl("FlowThruOrderDetail.aspx?from={0}&ID={1}&LineID={2}",Eval("LineID").ToString()) %>'
                                                                target="_self">
                                                                <img src="../Images/icon_edit.gif" class="img" style="border: none 0px blue;" alt="receipt" /></a>
                                                        </ItemTemplate>
                                                        <ItemStyle CssClass="GridViewRowWidth_50" HorizontalAlign="Center" />
                                                    </asp:TemplateField>
                                                    <asp:BoundField HeaderText="序号" FooterText="序号" meta:resourcekey="No">
                                                        <ItemStyle CssClass="GridViewRowWidth_40" />
                                                    </asp:BoundField>
                                                    <asp:TemplateField HeaderText="货品代码" FooterText="货品代码" SortExpression="" meta:resourcekey="SkuID">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblSkuID" runat="server" Text='<%# Eval("SkuID").ToString() %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <ItemStyle CssClass="GridViewRowWidth_100" />
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="Status" HeaderText="状态" FooterText="状态" SortExpression=""
                                                        meta:resourcekey="STATUSD">
                                                        <ItemStyle CssClass="GridViewRowWidth_100" />
                                                    </asp:BoundField>
                                                    <asp:TemplateField FooterText="订货数量" HeaderText="订货数量" SortExpression="" meta:resourcekey="ORIGINALQTY">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblORIGINALQTY" runat="server" Text='<%# GetPreferenceDigit(Eval("OriginalQty").ToString()) %>'
                                                                meta:resourcekey="lblORIGINALQTY"></asp:Label>
                                                        </ItemTemplate>
                                                        <ItemStyle CssClass="GridViewRowWidth_100" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField FooterText="已处理数量" HeaderText="已处理数量" SortExpression="" meta:resourcekey="PREALLOCATEDQTY">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblPREALLOCATEDQTY" runat="server" Text='<%# GetPreferenceDigit(Eval("ProcessedQty").ToString()) %>'
                                                                meta:resourcekey="lblPREALLOCATEDQTY"></asp:Label>
                                                        </ItemTemplate>
                                                        <ItemStyle CssClass="GridViewRowWidth_100" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField FooterText="开放数量" HeaderText="开放数量" SortExpression="" meta:resourcekey="ALLOCATEDQTY">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblALLOCATEDQTY" runat="server" Text='<%# GetPreferenceDigit(Eval("OpenQty").ToString()) %>'
                                                                meta:resourcekey="lblALLOCATEDQTY"></asp:Label>
                                                        </ItemTemplate>
                                                        <ItemStyle CssClass="GridViewRowWidth_100" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField FooterText="待处理数量" HeaderText="待处理数量" SortExpression="" meta:resourcekey="PICKEDQTY">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblPICKEDQTY" runat="server" Text='<%# GetPreferenceDigit(Eval("ToProcessQty").ToString()) %>'
                                                                meta:resourcekey="lblPICKEDQTY"></asp:Label>
                                                        </ItemTemplate>
                                                        <ItemStyle CssClass="GridViewRowWidth_100" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField FooterText="发货数量" HeaderText="发货数量" SortExpression="" meta:resourcekey="SHIPPEDQTY">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblSHIPPEDQTY" runat="server" Text='<%# GetPreferenceDigit(Eval("ShippedQty").ToString()) %>'
                                                                meta:resourcekey="lblSHIPPEDQTY"></asp:Label>
                                                        </ItemTemplate>
                                                        <ItemStyle CssClass="GridViewRowWidth_100" />
                                                    </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView>
                                        </div>
                                    </div>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr style="height: 30px;">
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <input type="hidden" id="hdnLineID" runat="server">
                <input id="hdnOrderID" runat="server" type="hidden"></input>
                <input id="hdnFlag" runat="server" type="hidden" value="0"></input>
                <input id="hdnCopy" runat="server" type="hidden"></input>
                <input id="hiddenReportFlag" type="hidden" />
            </ContentTemplate>
        </asp:UpdatePanel>
        <input type="hidden" id="hdnFrom" runat="server" />
        <input type="hidden" id="hdnInportValue" runat="server" />
        <input type="hidden" id="hdnImportPOValue" runat="server" />
        <input type="hidden" id="hdnDataFormat" runat="server" />
        <input type="hidden" id="hdncalendarFlag" runat="server" />
    </div>
    </form>
</body>
</html>
